package com.xbongbong.paas.manager.feign;

import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.pro.statistic.pojo.dto.ChartCategoryInitDTO;
import com.xbongbong.pro.statistic.pojo.dto.ChartCategorySaveDTO;
import com.xbongbong.pro.statistic.pojo.vo.ChartCategoryInitVO;
import com.xbongbong.pro.statistic.pojo.dto.CategoryPublishDTO;
import com.xbongbong.pro.statistic.pojo.vo.CategorySearchVO;
import com.xbongbong.pro.statistic.pojo.vo.ChartCategorySaveVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * @description: 内部调用接口
 * @Author: hongxiao
 * @date: 2019-02-28 16:29
 * @since v1.0
 */
@FeignClient(name = "pro-web-statistics",contextId = "chartCategoryFeignClient")
public interface ChartCategoryFeignClient {
    /**
     * 初始化指标分类列表，指标列表
     * @param chartCategoryInitDTO 入参
     * @return 公司首页看板配置数据
     */
    @RequestMapping(value = "/pro/v1/chart/category/init/categoryAndChart", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<ChartCategoryInitVO> chartCategoryInit(@RequestBody ChartCategoryInitDTO chartCategoryInitDTO, @RequestParam("lang") String lang);

    /**
     * 获取公司首页看板配置数据（指标分类列表，指标列表）
     * @param chartCategoryInitDTO 入参
     * @return 公司首页看板配置数据
     */
    @RequestMapping(value = "/pro/v1/chart/get/index/categoryAndChart", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<ChartCategoryInitVO> getIndexCategoryAndChart(@RequestBody ChartCategoryInitDTO chartCategoryInitDTO, @RequestParam("lang") String lang);

    /**
     * 仪表盘发布接口
     * @param categoryPublishDTO 入参
     */
    @RequestMapping(value = "/pro/v1/chart/dashboard/publish", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<CategorySearchVO>  categoryPublish(@RequestBody @Valid CategoryPublishDTO categoryPublishDTO, @RequestParam("lang") String lang);

    /**
     * 仪表盘发布接口
     * @param chartCategorySaveDTO 入参
     */
    @RequestMapping(value = "/pro/v1/chart/category/save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<ChartCategorySaveVO>  chartCategorySave(@RequestBody @Valid ChartCategorySaveDTO chartCategorySaveDTO, @RequestParam("lang") String lang);
}
